clear all; clc; close all;

alfa_f=deg2rad(10);
beta_f=deg2rad(10);

alfa_s=deg2rad(-90:5:90);
beta_s=deg2rad(-90:5:90);

beta = func_H(alfa_f,beta_f);

F=nan(length(alfa_s),length(beta_s));

for a=1:length(alfa_s)
    for b=1:length(beta_s)
        s=1;
        y=func_H(alfa_s(a),beta_s(a))*s;
        U=beta'*y;
        F(a,b)=abs(U/s)^2;
    end
end

[alfa_sm,beta_sm]=meshgrid(alfa_s,beta_s);


[Fx,Fy,Fz]=sph2cart(beta_sm,alfa_sm,F.');




figure;
surf(Fx,Fy,Fz);
%surf(alfa_s,beta_s,F)